home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / tcxl551.arc / TCXL_INC.EXE / lha / INC / TCXLDEF.H < prev    next >
Text File  |  1990-10-01  |  11KB  |  234 lines

  1. /*=====[ The TesSeRact(TM) CXL User Interface Development System ]======*
  2.  | Copyright (c) 1987-1990, Innovative Data Concepts. All Rights Reserved
  3.  |
  4.  | This Library is part of IDC's TesSeRact Development Tools product
  5.  | line. For information about other IDC products, call 1-215-884-3373.
  6.  *----------------------------------------------------------------------*
  7.  | <TCXLdef.h> : TCXL global MS-DOS definitions and function prototypes.
  8.  *-------------------------------[ NOTES ]------------------------------*
  9.  | 1) This file is included by all other <TCXLxxx.h> header files and so
  10.  |    need not be included if any of them are.
  11.  | 2) Compiler-dependent definitions are isolated in separate files
  12.  |    included here.
  13.  | 3) For all supported MS_DOS compilers, all TCXL functions except those
  14.  |    taking variable arguments use the faster, more compact Pascal
  15.  |    calling convention, defined as CTYP.
  16.  | 4) The compiler-specific "ANSI Keywords Only" options cannot be used
  17.  |    for TCXL, due to use of common extended keywords.
  18.  | 5) The crufty MsXxx() macros exist solely for typecasts to shut up a
  19.  |    lot of MEANINGLESS NOISE in the form of warning essages generated
  20.  |    by the M$C 5.1 and 6.0 MS-DOS compilers about assigning 8-bit
  21.  |    variables to 16-bit values or comparing signed and unsigned
  22.  |    values!  Just one of the many inane things needed for portability!
  23.  *----------------------------------------------------------------------*
  24.  | PGS : $Id: tcxldef.h 5.51 90/10/01 00:00:00 MLM Release Locker: MLM $
  25.  | $Log:    tcxldef.h $
  26.  | Revision 5.51  90/10/01  00:00:00  MLM
  27.  | TCXL 5.51
  28.  | 
  29.  *======================================================================*/
  30. #ifndef  _TCXLdef_
  31. #  define   _TCXLdef_ 1       /* only once! */
  32.  
  33. /*--------------------[ Supported MS-DOS compilers ]--------------------*/
  34.  
  35. #  undef    _TCXL_cc_
  36. #  undef    _TCXL_msc_
  37. #  ifdef __TURBOC__           /* Turbo C 2.0 or Turbo C++ 1.0 or later */
  38. #     include  <TCXL_tc.h>
  39. #  else
  40. #     ifdef __ZTC__           /* Zortech C/C++ 2.0 or later */
  41. #        include  <TCXL_ztc.h>
  42. #     else
  43. #        ifdef    M_I86       /* Micro$oft C 5.1 or later */
  44. #           include  <TCXL_msc.h>
  45. #        endif
  46. #     endif
  47. #  endif
  48. #  ifndef   _TCXL_cc_
  49. #     error Unsupported Compiler!
  50. #  endif
  51.  
  52. /*------------------------[ TCXL configuration ]------------------------*/
  53.  
  54. #define  TCXLVER  0x0533      /*- TCXL version = 5.51 ------------------*/
  55.                               /*- TcxlSys values -----------------------*/
  56. #define  SYS_DOS  0x0000      /* MS-DOS/PC-DOS/DR_DOS */
  57. #define  SYS_JDS  0x0001      /* Japan DOS            */
  58. #define  SYS_OS2  0x0002      /* half an OS <;-)>     */
  59. #define  SYS_XNX  0x0003      /* MS/SCO Xenix         */
  60. #define  SYS_UNX  0x0004      /* AT&T Unix            */
  61. #define  SYS_BSD  0x0005      /* BSD Unix             */
  62. #define  SYS_AIX  0x0006      /* IBM AIX              */
  63. #define  SYS_VMS  0x0007      /* DEC VMS              */
  64.                               /*- TcxlEnv bits (DOS) -------------------*/
  65. #define  ENV_MOU  0x0001      /* rodent               */
  66. #define  ENV_KEY  0x0002      /* enhanced keyboard    */
  67. #define  ENV_UV   0x0004      /* Ultravision          */
  68. #define  ENV_ESA  0x0010      /* EISA bus             */
  69. #define  ENV_MCA  0x0020      /* MCA bus              */
  70.  
  71. /*----------------[ Portability and shorthand notation ]----------------*/
  72.  
  73. #define  CON      const
  74. #define  CTYP     PAS
  75. #define  GBL      extern
  76. #define  LCL      static
  77. #define  REG      register
  78. #define  SIZ(c)   sizeof(c)
  79. #define  TYP      typedef
  80. #define  UNS      unsigned
  81. #define  VOID     void
  82. #define  VOL      volatile
  83. #ifdef   __cplusplus
  84. #  define   NOARG             /* remove (void) cruft for C++ */
  85. #else
  86. #  define   NOARG void        /* leave (void) cruft for C */
  87. #endif
  88. #ifdef EOS
  89. #  undef EOS
  90. #endif
  91. #define  EOS   '\x00'         /* End_Of_String */
  92. #ifdef NUL
  93. #  undef NUL                  /* NulTerm */
  94. #endif
  95. #define  NUL      EOS         /* ASCII NULl char */
  96. #define  BEL      '\x07'      /* Common control codes */
  97. #define  BS       '\x08'
  98. #define  HT       '\x09'
  99. #define  LF       '\x0A'
  100. #define  FF       '\x0C'
  101. #define  CR       '\x0D'
  102. #define  ESC      '\x1B'
  103. #ifdef EOF
  104. #  undef EOF
  105. #endif
  106. #define  EOF      (-1)        /* End_Of_File */
  107. #define  CpmEof   '\x1A'      /* CP/M-style [PDP-8!] ^Z EOF */
  108. #define  CtlZ     CpmEof      /* ... alias */
  109. #ifdef   FALSE
  110. #  undef FALSE
  111. #endif
  112. #ifdef   TRUE
  113. #  undef TRUE
  114. #endif
  115. #define  FALSE 0              /* Boolean absolutes */
  116. #define  TRUE  1
  117. #define  YES   TRUE           /* ... aliases */
  118. #define  NO    FALSE
  119. #define  ON    TRUE
  120. #define  OFF   FALSE
  121.  
  122. /*------------------------[ Error-return values ]-----------------------*/
  123.  
  124. #define  ERR_MEM  (-2)        /* allocation failure   */
  125. #define  ERR_ARG  (-1)        /* argument failure     */
  126. #define  ERR_NUL  0           /* successful return    */
  127. #define  ERR_ESC  1           /* [Esc] pressed        */
  128.  
  129. /*---------[ TCXL standard object, pointer and indirect types ]---------*/
  130. /*                Object Pointer Indirect                               */
  131. TYP   VOID              *AnyP, **AnyI;       /* anonymous void pointer  */
  132. TYP   VOID FAR          *AnyFP;              /* ... far-pointer         */
  133. TYP   char        ChrT, *ChrP, **ChrI;       /* 8-bit char              */
  134. TYP   ChrT FAR          *ChrFP;              /* ... far-pointer         */
  135. TYP   ChrT              *StrP, **StrI;       /* NulTerm string          */
  136. TYP   UNS char    BytT, *BytP, **BytI;       /* 8-bit unsigned byte     */
  137. TYP   BytT FAR          *BytFP;              /* ... far-pointer         */
  138. TYP   BytT        FlgT, *FlgP, **FlgI;       /* 8-bit Boolean flag      */
  139. TYP   short       IntT, *IntP, **IntI;       /* 16-bit signed int       */
  140. TYP   IntT FAR          *IntFP;              /* ... far-pointer         */
  141. TYP   UNS short   WrdT, *WrdP, **WrdI;       /* 16-bit unsigned word    */
  142. TYP   WrdT FAR          *WrdFP;              /* ... far-pointer         */
  143. TYP   long        LngT, *LngP, **LngI;       /* 32-bit signed long      */
  144. TYP   LngT FAR          *LngFP;              /* ... far-pointer         */
  145. TYP   UNS long    DwdT, *DwdP, **DwdI;       /* 32-bit unsigned dword   */
  146. TYP   DwdT FAR          *DwdFP;              /* ... far-pointer         */
  147. TYP   float       FltT, *FltP, **FltI;       /* 32-bit real             */
  148. TYP   double      DblT, *DblP, **DblI;       /* 64-bit real             */
  149. TYP   WrdT        LenT, *LenP, **LenI;       /* alias for ANSI size_t   */
  150. TYP   LngT        PosT, *PosP, **PosI;       /* alias for ANSI fpos_t   */
  151. TYP   WrdT        NdxT, *NdxP, **NdxI;       /* unsigned array-indices  */
  152. TYP   IntT        ArgT;                      /* bytes/chars as ints     */
  153. /*--------------------[ TCXL-specific type-aliases ]--------------------*/
  154.  
  155. TYP   BytT  AtrT, *AtrP;               /* video attribute               */
  156. TYP   WrdT  KeyT, *KeyP;               /* keycode (char/scan)           */
  157. TYP   IntT  TagT, *TagP;               /* item/field/help tag-id        */
  158. TYP   IntT  WndT, *WndP;               /* window handle                 */
  159. #ifdef   _TCXL_msc_
  160. #  define   MsByt(x) (BytT)(x)         /* crufty casts to shut up M$C */
  161. #  define   MsAtr(x) (AtrT)(x)
  162. #  define   MsChr(x) (ChrT)(x)
  163. #  define   MsInt(x) (IntT)(x)
  164. #else
  165. #  define   MsByt(x) (x)               /* no crufty casts */
  166. #  define   MsAtr(x) (x)
  167. #  define   MsChr(x) (x)
  168. #  define   MsInt(x) (x)
  169. #endif
  170.  
  171. /*------------------[ Common function-pointer types ]-------------------*/
  172.  
  173. TYP   VOID  (CTYP *VfvCP)(NOARG);            /* VOID (*function)(NOARG) */
  174. TYP   VOID  (CTYP *VfiCP)(IntT);             /* VOID (*function)(IntT)  */
  175. TYP   IntT  (CTYP *IfcpCP)(ChrP);            /* IntT (*function)(ChrP)  */
  176. TYP   WrdT  (CTYP *WfipCP)(IntP);            /* WrdT (*function)(IntP)  */
  177.  
  178. /*------------------[ Data-objects and access macros ]------------------*/
  179.  
  180. TYP   struct   Tcxl  TcxlT;
  181. struct   Tcxl           /*-[ TCXL-control object ]----*/
  182. {  IntT  terr;          /* 00|00 : error code         */
  183.    IntT  tdbg;          /* 02|02 : debug-level        */
  184.    WrdT  tsys;          /* 04|04 : operating system   */
  185.    WrdT  tenv;          /* 06|06 : environment bits   */
  186.    WrdT  tcfg;          /* 08|08 : configuration bits */
  187. };                      /* 0A|0A ]--------------------*/
  188.  
  189. GBL   TcxlT CDC   _TcxlCtl;   /*- global TCXL control object -----------*/
  190. #define  TcxlErr  (_TcxlCtl.terr)                     /* error code     */
  191. #define  TcxlDbg  (_TcxlCtl.tdbg)                     /* debug-level    */
  192. #define  TcxlSys  (_TcxlCtl.tsys)                     /* system         */
  193. #define  TcxlDos  (TcxlSys == SYS_DOS)                /*    DOS         */
  194. #define  TcxlJds  (TcxlSys == SYS_JDS)                /*    Japan DOS   */
  195. #define  TcxlOs2  (TcxlSys == SYS_OS2)                /*    OS/2        */
  196. #define  TcxlXnx  (TcxlSys == SYS_XNX)                /*    Xenix       */
  197. #define  TcxlUnx  (TcxlSys == SYS_UNX)                /*    AT&T Unix   */
  198. #define  TcxlBsd  (TcxlSys == SYS_BSD)                /*    BSD Unix    */
  199. #define  TcxlAix  (TcxlSys == SYS_AIX)                /*    IBM AIX     */
  200. #define  TcxlVms  (TcxlSys == SYS_VMS)                /*    DEC VMS     */
  201. #define  TcxlEnv  (_TcxlCtl.tenv)                     /* environment    */
  202. #define  TcxlMou  (0 != (TcxlEnv & ENV_MOU))          /*    rodent      */
  203. #define  TcxlKey  (0 != (TcxlEnv & ENV_KEY))          /*    101-key     */
  204. #define  TcxlUv   (0 != (TcxlEnv & ENV_UV))           /*    Ultravision */
  205. #define  TcxlEsa  (0 != (TcxlEnv & ENV_ESA))          /*    EISA bus    */
  206. #define  TcxlMca  (0 != (TcxlEnv & ENV_MCA))          /*    MCA bus     */
  207. #define  TcxlCfg  (_TcxlCtl.tcfg)                     /* configuration  */
  208.  
  209. /*------------------------[ Function prototypes ]-----------------------*/
  210.  
  211. #ifdef   __cplusplus          /* no mangling, please */
  212.    extern   "C"   {
  213. #endif
  214. VOID  PAS   _Delay(WrdT d);            /* delay for <d> clock-ticks     */
  215. VOID  PAS   _StdOut(ArgT ch);          /* put char                      */
  216. VOID  PAS   _StdOutS(ChrP s);          /* put string                    */
  217. DwdT  PAS   _Timer(NOARG);             /* get system timer              */
  218. VOID  PAS   _WaitMs(IntT ms);          /* wait (delay) for <ms> millisec*/
  219. VOID        Beep(NOARG);               /* honk the horn                 */
  220. ChrP  CTYP  RandFile(NOARG);           /* generate random filename      */
  221. VOID  CTYP  Sound(WrdT pv, WrdT dt);   /* make noise                    */
  222. ChrP  CTYP  SysDate(IntT d);           /* system date as string         */
  223. ChrP  CTYP  SysTime(IntT t);           /* system time as string         */
  224. IntT  PAS   TabNxt(IntT c, IntT w);    /* next tab-stop                 */
  225. VOID  CTYP  TcxlInit(NOARG);           /* initialize TCXL               */
  226. VOID  CDC   TcxlTerm(NOARG);           /* terminate TCXL                */
  227. WrdP        TcxlVer(NOARG);            /* get TCXL version number       */
  228. #define  Beep()   _StdOut(BEL)
  229. #define  TcxlVer()   TCXLVER
  230. #ifdef __cplusplus
  231.    }
  232. #endif
  233. #endif   /* _TCXLdef_ : End of TCXLDef.h */
  234.